home *** CD-ROM | disk | FTP | other *** search
/ 9-Digit Zip Code Directory / 9-Digit Zip Code Directory (American Business Information) (ABIZIP-12).ISO / z4src.zip / ZIABOUT.CPP < prev    next >
C/C++ Source or Header  |  1993-08-18  |  3KB  |  119 lines

  1. //----------------------------------------------------------------------------
  2. //                            MODULE DESCRIPTION
  3. //
  4. //  Module:    zn.cpp
  5. //   Title:    Zinc Window Template
  6. //  Notice:    John M. Weeder
  7. //                 Copyright (c) 1993. All rights reserved.
  8. //             This module contains proprietary information and should be 
  9. //                treated as confidential.
  10. //
  11. //----------------------------------------------------------------------------
  12. //                           MAINTENANCE HISTORY
  13. //
  14. // $Workfile$
  15. // $Revision$
  16. //   $Author$
  17. //     $Date$
  18. //      $Log$    
  19. //
  20. //----------------------------------------------------------------------------
  21. //                             MODULE NARRATIVE
  22. //
  23. //    This module contains code for the class ZI_ABOUT.
  24. //
  25. //    The code in this module may be written in C++ or C.
  26. //
  27. //    This module is portable to:
  28. //        DOS 3.X+
  29. //        MS Windows 3.X+
  30. //        OS/2 2.X+
  31. //        OS/2 2.0 PM
  32. //
  33. //    The following compilers are supported:
  34. //        MSC 6.0A
  35. //        MSC/C++ 7.0
  36. //        Borland C++ 3.1 for DOS
  37. //        Borland C++ 1.0 for OS/2 2.X
  38. //
  39. //----------------------------------------------------------------------------
  40. #include <zi.hpp>
  41. #define USE_WIN_ABOUT
  42. #if OS_DOS
  43. #include <zid.hpp>
  44. #elif OS_WINDOWS
  45. #include <ziw.hpp>
  46. #else
  47. #include <zio.hpp>
  48. #endif
  49.  
  50.  
  51. //----------------------------------------------------------------------------
  52. //   Description:    Default constructor
  53. //    Parameters:
  54. //       Returns:    
  55. //----------------------------------------------------------------------------
  56. FN_M ZI_ABOUT::ZI_ABOUT()
  57. : ZN_WINDOW("WIN_ABOUT", ZN_LOAD_CENTER|ZN_LOAD_NO_SHOW)
  58. {
  59.     ZI_ABOUT::Initialize(CL_INIT_CLASS);
  60.     Setup();
  61. }
  62.  
  63.  
  64. //----------------------------------------------------------------------------
  65. //   Description:    Destructor
  66. //    Parameters:
  67. //       Returns:    
  68. //----------------------------------------------------------------------------
  69. FN_M ZI_ABOUT::~ZI_ABOUT()
  70. {
  71.     ZI_ABOUT::Destroy(FALSE);
  72.     Terminate();
  73. }
  74.  
  75.  
  76. //----------------------------------------------------------------------------
  77. //   Description:    Event monitor function.
  78. //    Parameters:    msg        Event code
  79. //                        pv1            Data pointer 1
  80. //                        pv2            Data pointer 2
  81. //       Returns:    Event code
  82. //----------------------------------------------------------------------------
  83. ZN_MSG FN_M ZI_ABOUT::User(ZN_MSG msg, PVOID, PVOID)
  84. {
  85.     switch (msg)
  86.         {
  87.         case ZN_MSG_INIT:
  88.             {
  89.             CHAR szFormat[80];
  90.  
  91.             sprintf(szFormat, "Version %s", CfgGet(CFG_VERSION));
  92.             SetString(FID(STR_VERSION), szFormat);
  93.             CL_PARM cl_parm;
  94.             TIMET timeExpire;
  95.             cl_parm.SetName("EXPIRE_DATE");
  96.             cl_parm.Get(NULL, "EXPIRE_DATE");
  97.             timeExpire = (TIMET)(ULONG)cl_parm;
  98.             SetDate(FID(DATE_EXPIRE), timeExpire);
  99.             }
  100.             return msg;
  101.  
  102.         case ZN_MSG_TERMINATE:
  103.             return msg;
  104.         }
  105.     if (IsError())                                // Error condition
  106.         return msg;
  107.     switch (msg)
  108.         {
  109.         case BUTTON_OK:
  110.             Close();
  111.             break;
  112.         }
  113.     return msg;
  114. }
  115. //----------------------------------------------------------------------------
  116. //------------------------------- End of File --------------------------------
  117. //----------------------------------------------------------------------------
  118.  
  119.